#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>


typedef int HPDataType;
typedef struct Heap
{
	HPDataType* nums;
	int size;
	int capacity;
}Heap;
void AdjustDown(int* nums, int n, int parent);
void AdjustUp(int* nums, int child);

void HeapInit(Heap* php);
void HeapDestroy(Heap* php);

void HeapPush(Heap* php, HPDataType x);
void HeapPop(Heap* php);

bool HeapEmpty(Heap* php);

HPDataType HeapTop(Heap* php);
int HeapSize(Heap* php);